﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category1
{
  public class MT110 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagChoiceDefinition U0004;
    private static SwiftTagDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagChoiceDefinition U0013;
    private static SwiftTagDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagSubItemDefinition U0019;
    private static SwiftTagDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagSubItemDefinition U001C;
    private static SwiftTagDefinition U001D;
    private static SwiftTagSequenceDefinition U001E;
    private static SwiftTagDefinition U001F;
    private static SwiftTagSubItemDefinition U007F;
    private static SwiftTagDefinition U0080;
    private static SwiftTagSubItemDefinition U0081;
    private static SwiftTagChoiceDefinition U0082;
    private static SwiftTagDefinition U0083;
    private static SwiftTagSubItemDefinition U0084;
    private static SwiftTagSubItemDefinition U0086;
    private static SwiftTagSubItemDefinition U0087;
    private static SwiftTagDefinition U0088;
    private static SwiftTagSubItemDefinition U0089;
    private static SwiftTagSubItemDefinition U008A;
    private static SwiftTagChoiceDefinition U008B;
    private static SwiftTagDefinition U008C;
    private static SwiftTagSubItemDefinition U008D;
    private static SwiftTagSubItemDefinition U008E;
    private static SwiftTagDefinition U008F;
    private static SwiftTagSubItemDefinition U0090;
    private static SwiftTagSubItemDefinition U0091;
    private static SwiftTagDefinition U0092;
    private static SwiftTagSubItemDefinition U0093;
    private static SwiftTagSubItemDefinition U0094;
    private static SwiftTagDefinition U0095;
    private static SwiftTagSubItemDefinition U0096;
    private static SwiftTagSubItemDefinition U0097;

    [Description("Sender’s Reference")]
    public Tag20 SendersReference_20
    {
      get
      {
        return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0002);
      }
    }

    [Description("Sender’s Reference")]
    public Tag20 Tag20_SendersReference
    {
      get
      {
        return this.SendersReference_20;
      }
    }

    [Description("Sender’s Correspondent")]
    public Tag53A SendersCorrespondent_53A
    {
      get
      {
        return new Tag53A((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0005);
      }
    }

    [Description("Sender’s Correspondent")]
    public Tag53A Tag53A_SendersCorrespondent
    {
      get
      {
        return this.SendersCorrespondent_53A;
      }
    }

    [Description("Sender’s Correspondent")]
    public Tag53B SendersCorrespondent_53B
    {
      get
      {
        return new Tag53B((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0008);
      }
    }

    [Description("Sender’s Correspondent")]
    public Tag53B Tag53B_SendersCorrespondent
    {
      get
      {
        return this.SendersCorrespondent_53B;
      }
    }

    [Description("Sender’s Correspondent")]
    public MT110.Tag53D SendersCorrespondent_53D
    {
      get
      {
        return new MT110.Tag53D((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0010);
      }
    }

    [Description("Sender’s Correspondent")]
    public MT110.Tag53D Tag53D_SendersCorrespondent
    {
      get
      {
        return this.SendersCorrespondent_53D;
      }
    }

    [Description("Receiver's Correspondent")]
    public Tag54A ReceiversCorrespondent_54A
    {
      get
      {
        return new Tag54A((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0014);
      }
    }

    [Description("Receiver's Correspondent")]
    public Tag54A Tag54A_ReceiversCorrespondent
    {
      get
      {
        return this.ReceiversCorrespondent_54A;
      }
    }

    [Description("Receiver's Correspondent")]
    public MT110.Tag54B ReceiversCorrespondent_54B
    {
      get
      {
        return new MT110.Tag54B((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0017);
      }
    }

    [Description("Receiver's Correspondent")]
    public MT110.Tag54B Tag54B_ReceiversCorrespondent
    {
      get
      {
        return this.ReceiversCorrespondent_54B;
      }
    }

    [Description("Receiver's Correspondent")]
    public MT110.Tag54D ReceiversCorrespondent_54D
    {
      get
      {
        return new MT110.Tag54D((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U001A);
      }
    }

    [Description("Receiver's Correspondent")]
    public MT110.Tag54D Tag54D_ReceiversCorrespondent
    {
      get
      {
        return this.ReceiversCorrespondent_54D;
      }
    }

    [Description("SenderTo Receiver Information")]
    public MT110.Tag72 SenderToReceiverInformation_72
    {
      get
      {
        return new MT110.Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U001D);
      }
    }

    [Description("SenderTo Receiver Information")]
    public MT110.Tag72 Tag72_SenderToReceiverInformation
    {
      get
      {
        return this.SenderToReceiverInformation_72;
      }
    }

    [Description("Cheque Number")]
    public MT110.SequenceClass[] Sequence
    {
      get
      {
        int index = -1;
        List<MT110.SequenceClass> list = new List<MT110.SequenceClass>();
        int count;
        do
        {
          ++index;
          MT110.SequenceClass sequenceClass = new MT110.SequenceClass((SwiftElement) this, index, false);
          count = this.ListTags((SwiftElement) sequenceClass).Count;
          if (count > 0)
            list.Add(sequenceClass);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    public MT110()
      : base(true)
    {
    }

    public MT110(SwiftMessage message)
      : base(message)
    {
    }

    public MT110.SequenceClass AddSequence()
    {
      return new MT110.SequenceClass((SwiftElement) this, this.Sequence.Length, true);
    }

    public void RemoveSequence(MT110.SequenceClass sequence)
    {
      foreach (SwiftTag tag in this.ListTags((SwiftElement) sequence))
        this.RemoveTag(tag);
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT110.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT110.MessageDefinition = new SwiftMessageDefinition("MT110", "Advice of Cheque(s)");
      MT110.U0002 = new SwiftTagDefinition("SendersReference_20", "Sender’s Reference");
      MT110.U0002.TagName = ":20:";
      MT110.U0003 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT110.U0002.Elements.Add((SwiftDefinitionElement) MT110.U0003);
      MT110.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT110.U0002);
      MT110.U0004 = new SwiftTagChoiceDefinition("Choice", "");
      MT110.U0004.Mandatory = false;
      MT110.U0004.Multiple = true;
      MT110.U0005 = new SwiftTagDefinition("SendersCorrespondent_53A", "Sender’s Correspondent");
      MT110.U0005.TagName = ":53A:";
      MT110.U0006 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U0006.Mandatory = false;
      MT110.U0005.Elements.Add((SwiftDefinitionElement) MT110.U0006);
      MT110.U0007 = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT110.U0005.Elements.Add((SwiftDefinitionElement) MT110.U0007);
      MT110.U0004.Elements.Add((SwiftDefinitionElement) MT110.U0005);
      MT110.U0008 = new SwiftTagDefinition("SendersCorrespondent_53B", "Sender’s Correspondent");
      MT110.U0008.TagName = ":53B:";
      MT110.U000E = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U000E.Mandatory = false;
      MT110.U0008.Elements.Add((SwiftDefinitionElement) MT110.U000E);
      MT110.U000F = new SwiftTagSubItemDefinition("Location", "Location");
      MT110.U000F.Mandatory = false;
      MT110.U0008.Elements.Add((SwiftDefinitionElement) MT110.U000F);
      MT110.U0004.Elements.Add((SwiftDefinitionElement) MT110.U0008);
      MT110.U0010 = new SwiftTagDefinition("SendersCorrespondent_53D", "Sender’s Correspondent");
      MT110.U0010.TagName = ":53D:";
      MT110.U0011 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U0011.Mandatory = false;
      MT110.U0010.Elements.Add((SwiftDefinitionElement) MT110.U0011);
      MT110.U0012 = new SwiftTagSubItemDefinition("NameAndAddress", "Name and Address");
      MT110.U0010.Elements.Add((SwiftDefinitionElement) MT110.U0012);
      MT110.U0004.Elements.Add((SwiftDefinitionElement) MT110.U0010);
      MT110.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT110.U0004);
      MT110.U0013 = new SwiftTagChoiceDefinition("Choice", "");
      MT110.U0013.Mandatory = false;
      MT110.U0013.Multiple = true;
      MT110.U0014 = new SwiftTagDefinition("ReceiversCorrespondent_54A", "Receiver's Correspondent");
      MT110.U0014.TagName = ":54A:";
      MT110.U0015 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U0015.Mandatory = false;
      MT110.U0014.Elements.Add((SwiftDefinitionElement) MT110.U0015);
      MT110.U0016 = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT110.U0014.Elements.Add((SwiftDefinitionElement) MT110.U0016);
      MT110.U0013.Elements.Add((SwiftDefinitionElement) MT110.U0014);
      MT110.U0017 = new SwiftTagDefinition("ReceiversCorrespondent_54B", "Receiver's Correspondent");
      MT110.U0017.TagName = ":54B:";
      MT110.U0018 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U0018.Mandatory = false;
      MT110.U0017.Elements.Add((SwiftDefinitionElement) MT110.U0018);
      MT110.U0019 = new SwiftTagSubItemDefinition("Location", "Location");
      MT110.U0019.Mandatory = false;
      MT110.U0017.Elements.Add((SwiftDefinitionElement) MT110.U0019);
      MT110.U0013.Elements.Add((SwiftDefinitionElement) MT110.U0017);
      MT110.U001A = new SwiftTagDefinition("ReceiversCorrespondent_54D", "Receiver's Correspondent");
      MT110.U001A.TagName = ":54D:";
      MT110.U001B = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U001B.Mandatory = false;
      MT110.U001A.Elements.Add((SwiftDefinitionElement) MT110.U001B);
      MT110.U001C = new SwiftTagSubItemDefinition("NameAndAddress", "Name and Address");
      MT110.U001A.Elements.Add((SwiftDefinitionElement) MT110.U001C);
      MT110.U0013.Elements.Add((SwiftDefinitionElement) MT110.U001A);
      MT110.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT110.U0013);
      MT110.U001D = new SwiftTagDefinition("SenderToReceiverInformation_72", "SenderTo Receiver Information");
      MT110.U001D.TagName = ":72:";
      MT110.U001D.Mandatory = false;
      MT110.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT110.U001D);
      MT110.U001E = new SwiftTagSequenceDefinition("Sequence", "Cheque Number");
      MT110.U001E.Multiple = true;
      MT110.U001F = new SwiftTagDefinition("ChequeNumber_21", "Cheque Number");
      MT110.U001F.TagName = ":21:";
      MT110.U007F = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT110.U001F.Elements.Add((SwiftDefinitionElement) MT110.U007F);
      MT110.U001E.Elements.Add((SwiftDefinitionElement) MT110.U001F);
      MT110.U0080 = new SwiftTagDefinition("DateOfIssue_30", "Date of Issue");
      MT110.U0080.TagName = ":30:";
      MT110.U0081 = new SwiftTagSubItemDefinition("Date", "Date");
      MT110.U0080.Elements.Add((SwiftDefinitionElement) MT110.U0081);
      MT110.U001E.Elements.Add((SwiftDefinitionElement) MT110.U0080);
      MT110.U0082 = new SwiftTagChoiceDefinition("Choice", "");
      MT110.U0082.Multiple = true;
      MT110.U0083 = new SwiftTagDefinition("Amount_32A", "Amount");
      MT110.U0083.TagName = ":32A:";
      MT110.U0084 = new SwiftTagSubItemDefinition("Date", "Date");
      MT110.U0083.Elements.Add((SwiftDefinitionElement) MT110.U0084);
      MT110.U0086 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT110.U0083.Elements.Add((SwiftDefinitionElement) MT110.U0086);
      MT110.U0087 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT110.U0083.Elements.Add((SwiftDefinitionElement) MT110.U0087);
      MT110.U0082.Elements.Add((SwiftDefinitionElement) MT110.U0083);
      MT110.U0088 = new SwiftTagDefinition("Amount_32B", "Amount");
      MT110.U0088.TagName = ":32B:";
      MT110.U0089 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT110.U0088.Elements.Add((SwiftDefinitionElement) MT110.U0089);
      MT110.U008A = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT110.U0088.Elements.Add((SwiftDefinitionElement) MT110.U008A);
      MT110.U0082.Elements.Add((SwiftDefinitionElement) MT110.U0088);
      MT110.U001E.Elements.Add((SwiftDefinitionElement) MT110.U0082);
      MT110.U008B = new SwiftTagChoiceDefinition("Choice", "");
      MT110.U008B.Mandatory = false;
      MT110.U008B.Multiple = true;
      MT110.U008C = new SwiftTagDefinition("DrawerBank_52A", "Drawer Bank");
      MT110.U008C.TagName = ":52A:";
      MT110.U008D = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U008D.Mandatory = false;
      MT110.U008C.Elements.Add((SwiftDefinitionElement) MT110.U008D);
      MT110.U008E = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT110.U008C.Elements.Add((SwiftDefinitionElement) MT110.U008E);
      MT110.U008B.Elements.Add((SwiftDefinitionElement) MT110.U008C);
      MT110.U008F = new SwiftTagDefinition("DrawerBank_52B", "Drawer Bank");
      MT110.U008F.TagName = ":52B:";
      MT110.U0090 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U0090.Mandatory = false;
      MT110.U008F.Elements.Add((SwiftDefinitionElement) MT110.U0090);
      MT110.U0091 = new SwiftTagSubItemDefinition("Location", "Location");
      MT110.U0091.Mandatory = false;
      MT110.U008F.Elements.Add((SwiftDefinitionElement) MT110.U0091);
      MT110.U008B.Elements.Add((SwiftDefinitionElement) MT110.U008F);
      MT110.U0092 = new SwiftTagDefinition("DrawerBank_52D", "Drawer Bank");
      MT110.U0092.TagName = ":52D:";
      MT110.U0093 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT110.U0093.Mandatory = false;
      MT110.U0092.Elements.Add((SwiftDefinitionElement) MT110.U0093);
      MT110.U0094 = new SwiftTagSubItemDefinition("NameAndAddress", "Name And Address");
      MT110.U0092.Elements.Add((SwiftDefinitionElement) MT110.U0094);
      MT110.U008B.Elements.Add((SwiftDefinitionElement) MT110.U0092);
      MT110.U001E.Elements.Add((SwiftDefinitionElement) MT110.U008B);
      MT110.U0095 = new SwiftTagDefinition("Payee_59", "Payee");
      MT110.U0095.TagName = ":59:";
      MT110.U0096 = new SwiftTagSubItemDefinition("Account", "Account");
      MT110.U0096.Mandatory = false;
      MT110.U0095.Elements.Add((SwiftDefinitionElement) MT110.U0096);
      MT110.U0097 = new SwiftTagSubItemDefinition("NameAndAddress", "Name And Address");
      MT110.U0095.Elements.Add((SwiftDefinitionElement) MT110.U0097);
      MT110.U001E.Elements.Add((SwiftDefinitionElement) MT110.U0095);
      MT110.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT110.U001E);
    }

    public class Tag53D : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("53D", value);
        }
      }

      internal Tag53D(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }

    public class Tag54B : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("54B", value);
        }
      }

      internal Tag54B(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }

    public class Tag54D : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("54D", value);
        }
      }

      internal Tag54D(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }

    public class Tag72 : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("72", value);
        }
      }

      internal Tag72(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }

    public class SequenceClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT110.U001E;
        }
      }

      [Description("Cheque Number")]
      public Tag21 ChequeNumber_21
      {
        get
        {
          return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U001F);
        }
      }

      [Description("Cheque Number")]
      public Tag21 Tag21_ChequeNumber
      {
        get
        {
          return this.ChequeNumber_21;
        }
      }

      [Description("Date of Issue")]
      public Tag30 DateOfIssue_30
      {
        get
        {
          return new Tag30((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0080);
        }
      }

      [Description("Date of Issue")]
      public Tag30 Tag30_DateOfIssue
      {
        get
        {
          return this.DateOfIssue_30;
        }
      }

      [Description("Amount")]
      public Tag32A Amount_32A
      {
        get
        {
          return new Tag32A((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0083);
        }
      }

      [Description("Amount")]
      public Tag32A Tag32A_Amount
      {
        get
        {
          return this.Amount_32A;
        }
      }

      [Description("Amount")]
      public Tag32B Amount_32B
      {
        get
        {
          return new Tag32B((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0088);
        }
      }

      [Description("Amount")]
      public Tag32B Tag32B_Amount
      {
        get
        {
          return this.Amount_32B;
        }
      }

      [Description("Drawer Bank")]
      public Tag52A DrawerBank_52A
      {
        get
        {
          return new Tag52A((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U008C);
        }
      }

      [Description("Drawer Bank")]
      public Tag52A Tag52A_DrawerBank
      {
        get
        {
          return this.DrawerBank_52A;
        }
      }

      [Description("Drawer Bank")]
      public Tag52B DrawerBank_52B
      {
        get
        {
          return new Tag52B((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U008F);
        }
      }

      [Description("Drawer Bank")]
      public Tag52B Tag52B_DrawerBank
      {
        get
        {
          return this.DrawerBank_52B;
        }
      }

      [Description("Drawer Bank")]
      public Tag52D DrawerBank_52D
      {
        get
        {
          return new Tag52D((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0092);
        }
      }

      [Description("Drawer Bank")]
      public Tag52D Tag52D_DrawerBank
      {
        get
        {
          return this.DrawerBank_52D;
        }
      }

      [Description("Payee")]
      public MT110.SequenceClass.Tag59 Payee_59
      {
        get
        {
          return new MT110.SequenceClass.Tag59((SwiftElement) this, 0, (SwiftDefinitionElement) MT110.U0095);
        }
      }

      [Description("Payee")]
      public MT110.SequenceClass.Tag59 Tag59_Payee
      {
        get
        {
          return this.Payee_59;
        }
      }

      internal SequenceClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }

      public class Tag59 : SwiftTagWrapper
      {
        public string Value
        {
          get
          {
            return this.GetValue();
          }
          set
          {
            this.SetValue("59", value);
          }
        }

        internal Tag59(SwiftElement parent, int index, SwiftDefinitionElement definition)
          : base(parent, index, definition)
        {
        }
      }
    }
  }
}
